/*
 * Copyright (c) 2009. Silenus Consultoria, S.L.
 */
package es.silenus.detecta.dao;

import es.silenus.detecta.model.KnowledgeUnit;
import es.silenus.detecta.model.Qualification;

import java.util.List;
import java.util.Map;


/**
 * @author <a href="mailto:dgarcia@silenus-consultoria.es">Daniel Garc&iacute;a</a>
 * @since 01-abr-2009 11:29:55
 */
public interface QualificationDAO extends ReadWriteDAO<Qualification, Integer> {
	/**
	 * Retrieves the qualifications a given organization owns.
	 *
	 * @param organizationId the organization id.
	 *
	 * @return the list of qualifications.
	 */
	public List<Qualification> findByOrganization(int organizationId);

	/**
	 * Finds a qualification given its code and organization id.
	 *
	 * @param code the code.
	 * @param organizationId the organization id.
	 *
	 * @return the area.
	 */
	public Qualification findByCode(final String code, int organizationId);

	/**
	 * Finds units associated with the given criteria.
	 *
	 * @param sample the sample criteria.
	 * @param start the start index.
	 * @param limit the limit index.
	 * @param sortFields the sort fields.
	 * @param sortDirections the sort directions.
	 *
	 * @return the page.
	 */
	public Page<KnowledgeUnit> findAssociatedUnits(
		final Map<String, Object> sample, int start, int limit, final String[] sortFields, final String[] sortDirections);

	/**
	 * Finds units non associated with the given criteria.
	 *
	 * @param sample the sample criteria.
	 * @param start the start index.
	 * @param limit the limit index.
	 * @param sortFields the sort fields.
	 * @param sortDirections the sort directions.
	 *
	 * @return the page.
	 */
	public Page<KnowledgeUnit> findNonAssociatedUnits(
		final Map<String, Object> sample, int start, int limit, final String[] sortFields, final String[] sortDirections);

	/**
	 * Retrieves the removal information of entities with the given keys.
	 *
	 * @param keys the keys.
	 *
	 * @return the information requested.
	 */
	public List<Map<String, Object>> getRemovalInformation(final Integer[] keys);

	/**
	 * Removes qualifications by keys.
	 *
	 * @param keys the keys.
	 */
	public void remove(final Integer[] keys);
}
